import * as Api from "../../api/invoice";
const app = getApp();
// invoiced 已开票
// re_invoice_review 重开审核中
// re_invoice_rejected 驳回修正
// re_invoice_failed 重开失败
// cancelled 已退票
const detail = {
  id: "1",
  status: "invoiced",
  amount: "500",
  add_time: "2021-04-01  周一  12:00",
  invoice_type: "电子发票",
  invoice_detail: "*旅游娱乐服务*讲解服务",
  invoice_content: {
    title_type: "企业",
    title: "苏州随身玩信息技术有限公司",
    remark: "",
    tax_no: "9132 0594 3138 1341 62",
    address: "",
    bank_info: "",
    email: "rx.ma@suishenwan.cn",
  },
  order_info: {
    num: "1",
    first_order_time: "2021-04-01 12:00",
  },
};
Page({
  /**
   * 页面的初始数据
   */
  data: {
    detail: detail,
    iconServieGray2: "../../images/icon-servie-gray2.png",
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    Api.getInvoicedDetail(options.id).then((res) => {
      this.setData({
        detail: res,
      });
    });
  },

  /**
   * @description: 重开发票
   * @return {*}
   */
  onReInvoice() {
    wx.navigateTo({
      url: `/pages/reInvoiceSubmit/reInvoiceSubmit?invoice_id=${this.data.detail.id}`,
    });
  },
  makeCall() {
    wx.makePhoneCall({
      phoneNumber: "400-110-7981", // 替换为实际电话号码
      success() {
        console.log("拨打成功");
      },
      fail(err) {
        console.log("拨打失败", err);
      },
    });
  },
});
